﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;

namespace Cherry.Agile.Security
{
    /// <summary>
    /// 组织信息
    /// </summary>
    [Serializable]
    [DataContract]
    public class Organization
    {
        /// <summary>
        /// 组织Id
        /// </summary>
        [DataMember]
        public int Id { get; set; }

        /// <summary>
        /// 上级组织id
        /// </summary>
        [DataMember]
        public int ParentId { get; set; }


        /// <summary>
        /// 组织id路径，规则为id1,id2,id3
        /// </summary>
        [DataMember]
        public string Path { get; set; }

        /// <summary>
        /// 组织名称
        /// </summary>
        [DataMember]
        public string Name { get; set; }

        /// <summary>
        /// 组织类型
        /// </summary>
        [DataMember]
        public int Type { get; set; }

        /// <summary>
        /// 单位类型，对应OrgKindEnum 
        /// 总部 1
        /// 区域中心 2
        /// 医院 3
        /// 其它 4
        /// </summary>
        [DataMember]
        public int Kind { get; set; }

        /// <summary>
        /// 组织标识
        /// </summary>
        [DataMember]
        public OrganizationUsed Flag { get; set; }

        [DataMember]
        public virtual string Logofile
        {
            get;
            set;
        }

        [DataMember]
        public virtual string MembersSiteLogo
        {
            get;
            set;
        }
    }

    /// <summary>
    /// 
    /// </summary>
    [Flags]
    public enum OrganizationUsed
    {
        /// <summary>
        /// 没有使用
        /// </summary>
        None = 0,

        /// <summary>
        /// 已分配
        /// </summary>
        Assigned = 1,

        /// <summary>
        /// 可操作
        /// </summary>
        Processed =2,

        /// <summary>
        /// 
        /// </summary>
        All = Assigned | Processed
    }
}
